import request from "../utils/request";

// 获取列表请求
export function getListAPI(params) {
  return request({
    url: "",
    method: "get",
    params,
  });
}

// 新增列表请求
export function addListAPI(data) {
  return request({
    url: "",
    method: "post",
    data,
  });
}

// 获取详情接口 数据回填
export function getDetailAPI(id) {
  return request({
    url: `/${id}`,
    method: "get",
  });
}

// 编辑功能 更新数据
export function editListAPI(data) {
  return request({
    url: `/${data.id}`,
    method: "put",
    data,
  });
}

// 删除功能
export function delListAPI(id) {
  return request({
    url: `/${id}`,
    method: "delete",
  });
}

// 搜索功能
export function searchAPI(name) {
  return request({
    url: `/?name=${name}`,
    method: "get",
  });
}
